Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fields required in all groups and nodes requests #1515

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Oct 22, 2024

Closes #1485

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
134 133 0 1 0

Bundle Size: ✅

Current: 79.04 MB | Main: 79.03 MB
Diff: +0.00 MB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov changed the title fix: fields required in all storage and nodes requests fix: fields required in all groups and nodes requests Oct 22, 2024
@@ -11,5 +11,5 @@ export function getRequiredDataFields<ColumnId extends string, RequiredField ext
return fields;
}, new Set<RequiredField>());

return Array.from(requiredFieldsSet);
return Array.from(requiredFieldsSet).sort();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort to ensure no additional requests when order changes.

Example:
Columns [DiskSpace, Read], data fields [State, Read]
Columns [Read, State], data fields [Read, State]

Although it's the same data, it will be requested twice, because of different state keys ("fieldsRequired:State,Read" vs "fieldsRequired:Read,State"

@@ -40,7 +40,9 @@ export function StorageGroupPage() {
const shouldUseGroupsHandler = useStorageGroupsHandlerAvailable();
const capabilitiesLoaded = useCapabilitiesLoaded();
const groupQuery = storageApi.useGetStorageGroupsInfoQuery(
valueIsDefined(groupId) ? {groupId, shouldUseGroupsHandler, with: 'all'} : skipToken,
valueIsDefined(groupId)
? {groupId, shouldUseGroupsHandler, with: 'all', fieldsRequired: 'all'}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only 1 group is requested here and we need all its data

@@ -107,6 +107,7 @@ export const Storage = ({database, viewContext, nodeId, groupId, pDiskId}: Stora
groupId,
pDiskId,
shouldUseGroupsHandler: groupsHandlerAvailable,
fieldsRequired: 'all',
Copy link
Member Author

@artemmufazalov artemmufazalov Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to request data based on columns for not paginated storage. However, there is a problem: when you update columns, needed data fields are updated and data reloaded. For paginated table it isn't the issue, because it loads only 50 entities, but for not paginated tables requests take to long to load, so we need to avoid data reloads if possible.

I expect, that soon enough we will fix all issues with PaginatedTable and could get rid of DataTable in Storage

@artemmufazalov artemmufazalov added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit a9f79a3 Oct 23, 2024
7 checks passed
@artemmufazalov artemmufazalov deleted the 1485-request-only-needed-fields branch October 23, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request only needed fields in all storage and nodes requests (fields_required param)
2 participants